﻿@model OSBLE.Models.LogOnModel

@using OSBLE.Models

@{
    ViewBag.Title = "Log On";
    Layout = "~/Views/Shared/_LogOn.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {

        $('#sign_up_dialog').dialog({
            modal: true,
            autoOpen: false,
            resizable: false,
            width: 450,
            height: 200,
            closeOnEscape: true
        });

        $('#sign_up_link').click(function () {
            $('#sign_up_dialog').dialog('open');

            //This is to remove the focus from the create_academia_account so it doesn't have the box around it
            $('#create_academia_account').blur();
            return false;
        });

        if ($.browser.msie) {
            if ($.browser.version < 9.0) {
                $("#WarningMessages").html('You appear to be running an older version of Internet Explorer.  While we strive to make this site as compatible on as many browsers as possible, we do not have the resources needed to test older configurations.  If possible, please consider downloading the latest version of <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home">Internet Explorer</a>, <a href="http://www.mozilla.com/en-US/firefox/new/">Firefox</a>, or <a href="http://www.google.com/chrome">Chrome</a>.');
                $("#WarningMessages").css("display", "block");
            }
        }

    });

</script>
<div>Online Studio-Based Learning Environment</div>

<div id="WarningMessages" style="display:none;">
</div>

@Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")

@using (Html.BeginForm()) {
    <div>
            <div class="editor-label">
                @Html.LabelFor(m => m.UserName, "Email Address")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName, new { tabindex = "1" })<br />
                @Html.ValidationMessageFor(m => m.UserName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password, new { tabindex = "2" })<br />
                @Html.ValidationMessageFor(m => m.Password)
            </div>
            <div class="editor-label">
                @Html.CheckBoxFor(m => m.RememberMe, new { tabindex = "3" })
                @Html.LabelFor(m => m.RememberMe)
                @Helpers.CreateToolTip(ToolTips.AccountLogOnRemember) 
            </div>

            <!-- AC: Turn of captcha for now -->
            @if (false)
            { 
            <div>
            Are you are robot trying to brute force someone's password? Prove it!<br />
            Forgot your password? @Html.ActionLink("Click Here", "ResetPassword").
            <br />
            @Html.Partial("_ReCaptcha")
            </div>
            }

            <p>
                <input type="submit" value="Log On" />
            </p>
    </div>
    
    
    <p>
        Don't have an account? @Html.ActionLink("Sign Up", "Register", null, new {id= "sign_up_link", tabindex = "4" }).
    </p>
    <p>
        Forgot your password? @Html.ActionLink("Click Here", "ResetPassword").
    </p>
    <p>
        <!--Need help? <a href="#" tabindex="5">Click Here</a>.-->
        @Html.ActionLink("Contact Us/Support", "ContactUs") &mdash; 
        <a href="http://helplab.org/projects/osble" >About OSBLE</a> &mdash; 
        <a href="#" id="privacy_click">Privacy Notice</a> &mdash;
        <a href="http://www.youtube.com/watch?v=7EFCx56zRCQ">View Video</a> &mdash;
        <a href="http://osble.codeplex.com/">Get Involved</a>

        <script type="text/javascript">
            $(function () {



                $('#privacy_notice').dialog(
                {
                    autoOpen: false,
                    modal: true,
                    width: 550,
                    height: 550,
                    resizable: true,
                    title: "OSBLE Privacy Policy"
                }
                );

                $('#privacy_click').click(function () {
                    $('#privacy_notice').dialog('open');
                    return false;
                });

            });
        </script>
    </p>
    <table class="helplab_display">
    <tr>
    <td>
        <a href="http://www.helplab.org/"><img src="@Url.Content("~/Content/images/helplab_logo.png")" alt="HELPLab Logo" /></a>
    </td>
    <td>
        Developed by the <a href="http://www.helplab.org/">HELP Lab</a><br />
        At <a href="http://www.wsu.edu/">Washington State University</a><br />
        <span style="font-size:smaller;">Version @ViewBag.VersionNumber</span>
    </td>
    </tr>
    </table>
}

    <div id="privacy_notice">
        @Html.Partial("Privacy")
    </div>

    <div id="sign_up_dialog" title="Create Account">
    <p>Are you in academia (teachers, TAs, students) or the professional world?</p>
        @Html.ActionLink("Create Academic Account", "AcademiaRegister", "Account", new { id = "create_academia_account" }) | @Html.ActionLink("Create Professional Account", "ProfessionalRegister", "Account")
    </div>